#pragma once

// Base header for calculating geometry object's normal

#include <utils/config.h>
#include <utils/Concepts.h>
#include <algorithm/shared/utils/Vec3.h>

namespace solar
{
    template <typename T>
    auto normal(T* /*unused*/, bool lazy = true) -> Vec3
    {
        static_assert(false, "Don't use this generic **unimplemented** version, include the "
                             "corresponding header for detailed implementation");
    }

    template <ClassWithNormal T>
    auto normal(T* ptr, bool lazy = true) -> Vec3
    {
        return ptr->normal();
    }
    
    template <typename T>
    auto normalAt(T* /*unused*/, Vec3* /*unused*/, bool lazy = true) -> Vec3
    {
        static_assert(false, "Don't use this generic **unimplemented** version, include the "
                             "corresponding header for detailed implementation");
    }

    template <ClassWithNormalAt T>
    auto normalAt(T* ptr, Vec3* vec, bool lazy = true) -> Vec3
    {
        return ptr->normalAt(vec);
    }
}
